home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / ups / genpower.000 / genpower / genpower-1.0.1 / genpowerd.h < prev    next >
C/C++ Source or Header  |  1995-07-16  |  5KB  |  105 lines

  1. /************************************************************************/
  2. /* File Name            : genpowerd.h                                   */
  3. /* Program Name         : genpowerd                   Version: 1.0.1    */
  4. /* Author               : Tom Webster <webster@kaiwan.com>              */
  5. /* Created              : 1994/04/20                                    */
  6. /* Last Modified By     : Tom Webster                 Date: 1995/07/05  */
  7. /*                                                                      */
  8. /* Compiler (created)   : GCC 2.6.3                                     */
  9. /* Compiler (env)       : Linux 1.2.5                                   */
  10. /* ANSI C Compatable    : No                                            */
  11. /* POSIX Compatable     : Yes?                                          */
  12. /*                                                                      */
  13. /* Purpose              : Header file for genpowerd.                    */
  14. /*                      : Contains the configuration information for    */
  15. /*                      : genpowerd.  Edit this file as indicated       */
  16. /*                      : below to activate features and to customize   */
  17. /*                      : genpowerd for your UPS.                       */
  18. /*                                                                      */
  19. /* Copyright            : GNU Copyleft                                  */
  20. /************************************************************************/
  21. /*                                                                      */
  22. /* DO NOT EDIT THE FOLLOWING STRUCTURE AND VARIABLE DEFINITIONS         */
  23. /*                                                                      */
  24. /************************************************************************/
  25.  
  26. /* LINE type definition for input/output lines:
  27.    For outputs, the INACTIVE state must be specified !!
  28.    inverted=0 -> the output is set (pos. voltage) on startup [ RTS, DTR]
  29.    inverted=1 -> the output is cleared (neg. voltage) on startup [*RTS,*DTR]
  30.  
  31.    line==0 -> function is not supported, getlevel returns normal state (1).
  32.  */
  33.  
  34. typedef struct{
  35.         int line;
  36.         int inverted;      /* 0->active high, 1->active low */
  37.         } LINE;
  38.  
  39. /************************************************************************/
  40. /*                                                                      */
  41. /* DO NOT EDIT THE FOLLOWING *STRUCTURE*, UPS/CABLE DATA MAY BE EDITED  */
  42. /*                                                                      */
  43. /* The data in the UPS data structure may be edited and additional      */
  44. /* lines may be added.  The paths for the UPS status files may also be  */
  45. /* edited.  (init does expect to find powerstatus in "/etc".            */
  46. /*                                                                      */
  47. /* The TIOCM_ST serial line may be used ONLY for the inverter kill      */
  48. /* function.  genpower will NOT function properly if it is configured   */
  49. /* for use with other functions.                                        */
  50. /*                                                                      */
  51. /************************************************************************/
  52.  
  53. struct {
  54.         char *tag;
  55.         LINE    cablepower, kill;               /* outputs -> INACTIVE Level*/
  56.         int     killtime;                       /* killtime 0 -> Option -k is not supported ! */
  57.         LINE    powerok,battok,cableok;         /* inputs */
  58.         } *pups,ups[] = {
  59.  
  60. /* The lines inside these brackets may be edited to fit your UPS/cable.  Do NOT remove the {NULL} entry! */
  61.  
  62. /* type          cablep1        kill           t  powerok        battok         cableok */
  63.  
  64. /* Miquel's powerd cable */
  65.  {"powerd",      {TIOCM_RTS,0}, {TIOCM_DTR,1}, 0, {TIOCM_CAR,0}, {0,0},         {TIOCM_DSR,0}},
  66.  
  67. /* Classic TrippLite */
  68.  {"tripp-class", {TIOCM_RTS,0}, {TIOCM_ST,1},  5, {TIOCM_CAR,0}, {0,0},         {0,0}},
  69.  
  70. /* TrippLite WinNT */
  71.  {"tripp-nt",    {TIOCM_RTS,0}, {TIOCM_DTR,1}, 5, {TIOCM_CTS,1}, {TIOCM_CAR,1}, {0,0}},
  72.  
  73. /* Lam's APC Back-UPS, Victron Lite WinNT */
  74.  {"apc1-nt",     {TIOCM_RTS,0}, {TIOCM_DTR,1}, 5, {TIOCM_CTS,0}, {TIOCM_CAR,0}, {0,0}},
  75.  
  76. /* Jim's APC Back-UPS WinNT */
  77.  {"apc2-nt",     {TIOCM_RTS,0}, {TIOCM_DTR,1}, 5, {TIOCM_CTS,1}, {TIOCM_CAR,0}, {0,0}},
  78.  
  79. /* Marek's APC Back-UPS */
  80.  {"apc-linux",   {TIOCM_DTR,0}, {TIOCM_ST,1},  5, {TIOCM_CAR,1}, {TIOCM_DSR,0}, {0,0}},
  81.  
  82.  {NULL}
  83. };
  84.  
  85. /* The following are the RS232 control lines      */
  86. /*                                                */
  87. /*                                            D D */
  88. /*                                            T C */
  89. /* Macro           English                    E E */
  90. /* ---------------------------------------------- */
  91. /* TIOCM_DTR       DTR - Data Terminal Ready  --> */
  92. /* TIOCM_RTS       RTS - Ready to send        --> */
  93. /* TIOCM_CTS       CTS - Clear To Send        <-- */
  94. /* TIOCM_CAR       DCD - Data Carrier Detect  <-- */
  95. /* TIOCM_RNG       RI  - Ring Indicator       <-- */
  96. /* TIOCM_DSR       DSR - Data Signal Ready    <-- */
  97. /* TIOCM_ST        ST  - Data Xmit            --> */
  98.  
  99. #define PWRSTAT         "/etc/powerstatus"
  100. #define UPSSTAT        "/etc/upsstatus"
  101.  
  102. /************************************************************************/
  103. /* End of File genpowerd.h                                              */
  104. /************************************************************************/
  105.